"""project_1 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from .views import viewsIndex,viewsUser,viewsGoods,viewsCates,viewsOrder,viewAuth


urlpatterns = [
    # 主页
    url(r'^$', viewsIndex.index,name="myadmin_index"),
    # 用户
    url(r'^userindex/$', viewsUser.userindex,name='myadmin_user_index'),
    url(r'^useradd/$', viewsUser.useradd,name="myadmin_user_add"),
    url(r'^userdel/(?P<uid>[0-9]+)/$', viewsUser.userdel,name="myadmin_user_del"),
    url(r'^userupdate/(?P<uid>[0-9]+)/$', viewsUser.userupdate,name="myadmin_user_update"),
    # 商品分类
    url(r'^catesindex/$', viewsCates.index, name="myadmin_cates_index"),
    url(r'^catesadd/$', viewsCates.add, name="myadmin_cates_add"),
    url(r'^catesdel/$', viewsCates.delete, name="myadmin_cates_delete"),
    url(r"catesupdate/$", viewsCates.update, name="myadmin_cates_update"),
    url(r"catesquery/$",viewsCates.query,name="myadmin_cates_query"),
    # 商品
    url(r"^goodsindex", viewsGoods.index, name="myadmin_goods_index"),
    url(r"^goodsadd", viewsGoods.add, name="myadmin_goods_add"),
    url(r"^goodsdel/([0-9]+)/$", viewsGoods.delete, name="myadmin_goods_del"),
    url(r"^goodsupdate/([0-9]+)/$", viewsGoods.update, name="myadmin_goods_update"),

    # 订单管理
    url(r"^orderindex", viewsOrder.index, name="myadmin_order_index"),
    # 发货
    url(r"^orderfahuo$", viewsOrder.fahuo,name="myadmin_order_fahuo"),
    # 详情
    url(r"^orderlist", viewsOrder.list, name="myadmin_order_list"),

    # 登录
    url(r"^login/", viewAuth.mylogin, name="myadmin_login"),
    # 退出登录
    url(r"^logout/",viewAuth.mylogout, name="myadmin_logout"),
    # 验证码
    url(r"^verifycode/",viewsIndex.verifycode, name = "myadmin_verifycode"),


    # 后台权限管理
    # 后台用户添加
    url(r'^auth/user/add$',viewAuth.useradd, name="auth_user_add"),
    # 后台用户列表
    url(r"^auth/user/list$", viewAuth.userlist, name="auth_user_list"),
    # 后台用户删除
    url(r"auth/user/del/(?P<uid>[0-9]+)", viewAuth.userdel, name="auth_user_del"),

    # 后台组的添加
    url(r"^auth/group/add$", viewAuth.groupadd, name="auth_group_add"),
    # 后台组的列表
    url(r"^auth/group/list$", viewAuth.grouplist, name="auth_group_list"),
    # 后台组的修改
    url(r"auth/group/update/(?P<gid>[0-9]+)/$", viewAuth.authUpdate, name="auth_group_update")


]
